import { Component, OnInit, Inject } from '@angular/core';
import { Router } from '@angular/router';

@Component({
  selector: 'app-header',
  templateUrl: './header.component.html',
  styleUrls: ['./header.component.scss'],
})
export class HeaderComponent implements OnInit {
  constructor(@Inject('StoreService') private storeService, private router: Router) {}

  ngOnInit() {}

  async doLogout() {
    await this.storeService.dispatch('logout', {});
    this.router.navigate(['u/login']);
  }
}
